import {request} from '@/utils/request.js'
import {appConfig} from '@/config/config.js'

// 创建订单
export function createOrder(params) {
	return request.post(appConfig.WEB_API + '/order/create', params)
}

// 查询订单详细信息
export function getOrderInfo(orderId) {
	return request.get(appConfig.WEB_API + '/order/' + orderId)
}

// 分页查询我的买入订单列表
export function getBuyerOrderList(params) {
	return request.get(appConfig.WEB_API + '/order/buyerList', params)
}

// 分页查询我的卖出订单列表
export function getSellerOrderList(params) {
	return request.get(appConfig.WEB_API + '/order/sellerList', params)
}

// 订单取消
export function orderCancel(orderId) {
	return request.put(appConfig.WEB_API + '/order/cancel/' + orderId)
}

// 订单确认
export function orderConfirm(orderId) {
	return request.put(appConfig.WEB_API + '/order/confirm/' + orderId)
}
